<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
    <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/0.4.3/weui.min.css">
    <link rel="stylesheet" href="{{ url_for('static',filename='css/example.css',_external=True) }}"/>
    <script src="{{ url_for('static',filename='js/jquery.js',_external=True) }}"></script>
    <title>用户信息</title>
    <style type="text/css">
/*        a:hover {color: #ae9f9f;} 
        a:visited {color: #ae9f9f;} */
        /*a:link {color: #ae9f9f;} */
        /*a {color: #ae9f9f;}*/
        /*引用阿里巴巴的图库*/
        @font-face {
            font-family: 'iconfont';
            src: url('{{ url_for('static',filename='fonts/iconfont.eot',_external=True) }}'); /* IE9*/
            src: url('{{ url_for('static',filename='fonts/iconfont.woff',_external=True) }}') format('woff'), 
            url('{{ url_for('static',filename='fonts/iconfont.ttf',_external=True) }}') format('truetype'),
            url('{{ url_for('static',filename='fonts/iconfont.svg',_external=True) }}') format('svg'); /* iOS 4.1- */
        }
        .iconfont{
            font-family:"iconfont" !important;
            font-size:16px;font-style:normal;
            -webkit-font-smoothing: antialiased;
            -webkit-text-stroke-width: 0.2px;
            -moz-osx-font-smoothing: grayscale;
        }
    </style>
</head>
<body>

<!-- 个人信息 -->
<!-- <input type="hidden" name="publisher" value=""> -->
<!-- 外围框 -->
<div class="bd">

    <p style="font-size:0px; visibility: none;">发布者id:{{publisher}}</p>
    <p style="font-size:0px; visibility: none;">任务id:{{mission_id}}</p>
    <p style="font-size:0px; visibility: none;">当前登录用户id:{{current_user}}</p>

<!-- <div class="weui_panel weui_panel_access"> -->
    <!-- <div class="weui_panel_bd"> -->
    <div class="weui_cells weui_cells_access">
        <a href="javascript:void(0);" class="weui_cell weui_media_box weui_media_appmsg">
            <div class="weui_media_hd">
                <img class="weui_media_appmsg_thumb" src="" alt="">
            </div>
            <div class="weui_media_bd">
                <h4 class="weui_media_title">{{ user_obj.openid }}</h4>
                <h6>&nbsp;</h6>
                <p class="weui_media_desc"><i class="iconfont">&#xe618;</i>&nbsp;北京</p>
                <!-- <p class="weui_media_desc">{{ province }}</p> -->
            </div>
        </a>
    <!-- </div> -->
<!-- </div> -->


    <!-- <div class="weui_cells weui_cells_access"> -->
        <a class="weui_cell" href="javascript:;">
            <div class="weui_cell_hd"><i class="iconfont">&#xe621;</i></div>&nbsp;&nbsp;
            <div class="weui_cell_bd weui_cell_primary">
                <p>等级&nbsp;17</p>
            </div>
        </a>
        <a class="weui_cell" href="javascript:;">
            <div class="weui_cell_hd"><i class="iconfont">&#xe63a;</i></div>&nbsp;&nbsp;
            <div class="weui_cell_bd weui_cell_primary">
                <p>评价&nbsp;
                <i class="iconfont">&#xe61f;</i>
                <i class="iconfont">&#xe61f;</i>
                <i class="iconfont">&#xe61f;</i>
                <i class="iconfont">&#xe61f;</i>
                </p>
            </div>
        </a>
    </div>

    <div class="weui_panel weui_panel_access">
        <div class="weui_panel_hd"><i class="iconfont">&#xe607;</i>&nbsp;个人简介</div>
        <div class="weui_panel_bd">
            <div class="weui_media_box weui_media_text">
                <p class="weui_media_desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
            </div>
        </div>
    </div>





    <div class="weui_panel weui_panel_access">
        <div class="weui_panel_hd"><i class="iconfont">&#xe636;</i>&nbsp;已完成项目</div>
        <div class="weui_panel_bd">
            <div class="weui_media_box weui_media_text">
                <h4 class="weui_media_title">项目一</h4>
                <p class="weui_media_desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
            </div>
            <div class="weui_media_box weui_media_text">
                <h4 class="weui_media_title">项目二</h4>
                <p class="weui_media_desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
            </div>
        </div>
    </div>

    <div class="weui_panel weui_panel_access">
        <div class="weui_panel_hd"><i class="iconfont">&#xe60c;</i>&nbsp;技能</div>
        <div class="weui_panel_bd">
            <div class="weui_media_box weui_media_text">
                <h4 class="weui_media_title">技能一</h4>
                <p class="weui_media_desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
            </div>
            <div class="weui_media_box weui_media_text">
                <h4 class="weui_media_title">技能二</h4>
                <p class="weui_media_desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
            </div>
        </div>
    </div>

    <div class="weui_panel weui_panel_access">
        <div class="weui_panel_hd"><i class="iconfont">&#xe639;</i>&nbsp;认证</div>
        <div class="weui_panel_bd">
            <div class="weui_media_box weui_media_text">
                <h4 class="weui_media_title">认证一</h4>
                <p class="weui_media_desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
            </div>
            <div class="weui_media_box weui_media_text">
                <h4 class="weui_media_title">认证二</h4>
                <p class="weui_media_desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
            </div>
        </div>
    </div>






    <!-- 按钮 -->
    <div class="weui_btn_area" id="btn_main">
    <h2>{{current_user}}</h2>
    <h2>{{publisher}}</h2>
    <h3>{{hired}}</h3>
    {% if current_user==publisher and hired=='0' %}
        <a class="weui_btn weui_btn_primary" href="javascript:showDialog();" id="showTooltips">雇佣</a>

    {% else %}
    {% endif %}
        <a class="weui_btn weui_btn_default" href="javascript:history.back(-1);" id="showTooltips">返回</a>
    </div>

</div>



<!-- 确认对话框 -->
<div class="weui_dialog_confirm" style="display: none;" id="dialog">
    <div class="weui_mask"></div>
    <div class="weui_dialog">
        <div class="weui_dialog_hd"><strong class="weui_dialog_title">确认提示</strong></div>
        <div class="weui_dialog_bd">确认要雇佣他来完成项目么？</div>
        <div class="weui_dialog_ft">
            <a href="javascript:hideDialog();" class="weui_btn_dialog default">取消</a>
            <a href="javascript:forHire();" class="weui_btn_dialog primary">确定</a>
        </div>
    </div>
</div>



<!-- toast -->
<div id="hiresuccess" style="display: none;">
    <div class="weui_mask_transparent"></div>
    <div class="weui_toast">
        <i class="weui_icon_toast"></i>
        <p class="weui_toast_content">雇佣成功</p>
    </div>
</div>
<div id="hirefailed" style="display: none;">
    <div class="weui_mask_transparent"></div>
    <div class="weui_toast">
        <i class="weui_icon_toast"></i>
        <p class="weui_toast_content">雇佣失败</p>
    </div>
</div>



















<script>
    
function showDialog(){
$("#dialog").css("display","block");
};
function hideDialog(){
$("#dialog").css("display","none");
};

// 雇佣的ajax
// function forHire() {

//     $.ajax({
//         url:"http://bountyunions.applinzi.com/test/hire",
//         data:{
//             'mission_id':'{{mission_id}}',
//             'acceptor':'{{user_obj.openid}}'
//             },
//         type:"post",
//         // dataType:"json",
//         success:function(result){
//             if (result=='success') {
//                 $('#dialog').hide();
//                 // 显示toast
//                 $('#hiresuccess').show();
//                 setTimeout(function () {
//                     $('#hiresuccess').hide();
//                 }, 2000);
//                 $('#btn_main').html('<a class="weui_btn weui_btn_disabled weui_btn_default" href="javascript:;" >已雇佣</a><a class="weui_btn weui_btn_default" href="javascript:history.back(-1);" id="showTooltips">返回</a>')
//             }else{};
//         },
//         error:function(){
//             // 显示提示
//             $('#hirefailed').show();
//             setTimeout(function () {
//                 $('#hirefailed').hide();
//             }, 2000);
//         }
//     });

// };





// 重定跳转版本
// 雇佣的ajax
function forHire() {

    $.ajax({
        url:"http://bountyunions.applinzi.com/test/hire",
        data:{
            'mission_id':'{{mission_id}}',
            'acceptor':'{{user_obj.openid}}'
            },
        type:"post",
        // dataType:"json",
        success:function(result){
            if (result=='success') {
               location.href = "http://bountyunions.applinzi.com/test/hire_commit?mission_id={{mission_id}}&acceptor={{user_obj.openid}}"
            }else{};
        },
        error:function(){
            // 显示提示
            $('#hirefailed').show();
            setTimeout(function () {
                $('#hirefailed').hide();
            }, 2000);
        }
    });

};
</script>





</body>
</html>